﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="products.aspx.cs" Inherits="WebApplication.Products" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Products</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="scripts/script.js"></script>
<link href="styles/products.css" rel="stylesheet" type="text/css" />
</head>

<body>
<% Server.Execute("~/header.aspx"); %>
<div class="middle ct">
    <div class="main">
        <div class="nav">
            <label>You Location：</label>
            <a href="index.aspx">Home</a>
            <a href="products.aspx">Products</a>
        </div>
        <div class="content">
            <% if (guid == "") { %>
            <dl class="items">
                <asp:repeater runat="server" id="products_list">
                    <itemtemplate>
                <dd><a href="<%# DataBinder.Eval(Container.DataItem,"GUID") %>.aspx" target="_blank"><img src="/upload/products/<%# DataBinder.Eval(Container.DataItem,"GUID") %>.jpg" alt="" /><span><%# DataBinder.Eval(Container.DataItem,"Name") %></span></a></dd>
                    </itemtemplate>
                </asp:repeater>
            </dl>
            <qsl:pager id="pager" runat="server" limit="20" />
            <p class="return"><a href="products.aspx"><<- Return</a></p>
            <% } else { %>
            <h3 class="title"><asp:literal text="ProductName" runat="server" id="product_name" /></h3>
            <dl id="images" class="show">
                <dt id="scr"></dt>
                <asp:repeater runat="server" id="product_images">
                    <itemtemplate>
                <dd><a href="<%# DataBinder.Eval(Container.DataItem,"GUID") %>.ashx" rel="lytebox[x]"><img src="/upload/products/<%# DataBinder.Eval(Container.DataItem,"GUID") %>.jpg" alt="" width="80" height="60" /></a></dd>
                    </itemtemplate>
                </asp:repeater>
            </dl>
            <div class="article"><asp:literal text="Description" runat="server" id="product_intro" /></div>
            <dl class="items">
                <dt><span>Similar Products：</span><a href="products.aspx?type=<%= thetype %>">More...</a></dt>
                <asp:repeater runat="server" id="other_list">
                    <itemtemplate>
                <dd><a href="<%# DataBinder.Eval(Container.DataItem,"GUID") %>.aspx"><img src="/upload/products/<%# DataBinder.Eval(Container.DataItem,"GUID") %>.jpg" alt="" /><span><%# DataBinder.Eval(Container.DataItem,"Name") %></span></a></dd>
                    </itemtemplate>
                </asp:repeater>
            </dl>
            <script type="text/javascript" src="scripts/qsl.ui.flashshow.js"></script>
            <link href="scripts/lytebox/lytebox.css" rel="stylesheet" />
            <script type="text/javascript" src="scripts/lytebox/lytebox.js"></script>
            <script type="text/javascript">
                new FlashShow('scr', 5000, 'curr', $('images').child('img')).start();
            </script>
            <% } %>
        </div>
    </div>
    <div class="side">
        <h4>Product's Types</h4>
        <dl class="gates">
            <asp:repeater runat="server" id="types" onitemdatabound="types_ItemDataBound"><itemtemplate>
            <dd>
                <a class="<%# thetype.Equals(DataBinder.Eval(Container.DataItem,"Id"))?"current":"" %>" href="products.aspx?type=<%# DataBinder.Eval(Container.DataItem,"Id") %>"><%# DataBinder.Eval(Container.DataItem,"Name") %></a>
                <ul id="TYPE_<%# DataBinder.Eval(Container.DataItem,"Id") %>">
                    <asp:repeater runat="server" id="typeslv2" onitemdatabound="typeslv2_ItemDataBound"><itemtemplate>
                    <li>
                        <a class="<%# thetype.Equals(DataBinder.Eval(Container.DataItem,"Id"))?"current":"" %>" href="products.aspx?type=<%# DataBinder.Eval(Container.DataItem,"Id") %>"><%# DataBinder.Eval(Container.DataItem,"Name") %></a>
                        <ul id="TYPE_<%# DataBinder.Eval(Container.DataItem,"Id") %>">
                            <asp:repeater runat="server" id="typeslv3"><itemtemplate>
                            <li><a id="TYPE_<%# DataBinder.Eval(Container.DataItem,"Id") %>" class="<%# thetype.Equals(DataBinder.Eval(Container.DataItem,"Id"))?"current":"" %>" href="products.aspx?type=<%# DataBinder.Eval(Container.DataItem,"Id") %>">&gt; <%# DataBinder.Eval(Container.DataItem,"Name") %></a></li>
                            </itemtemplate></asp:repeater>
                        </ul>
                    </li>
                    </itemtemplate></asp:repeater>
                </ul>
            </dd>
            </itemtemplate></asp:repeater>
        </dl>
    </div>
</div>
<% Server.Execute("~/footer.aspx"); %>
</body>
</html>
<script type="text/javascript">
    var t = document.getElementById('TYPE_<%=thetype%>');
    while (t && (t.tagName == 'UL' || t.tagName == 'A')) {
        t.style.display = 'block';
        t = t.parentNode.parentNode;
    }
</script>
